<script setup lang="ts">
import { reactive,toRef } from 'vue'

const man = reactive({
	name: '张三',
	age: 18,
	sex: '男'
})

const age = toRef(man,'age')
// const age = man.age
console.log(age)

function change(){
  
  man.age = 20
  console.log(age);
  
}
</script>

<template>
  <div>
	age:{{ age }}
	<!-- age -->
  <button @click="change">修改</button>
  </div>
</template>

<style scoped>
div {
  margin: 0 auto;
  text-align: center;
}
</style>
